package com.test.design.pattern.factory.factory_method;


/**
 * @ClasName Client
 * @Descripution TODO
 * @Author leikw
 * @Date 2021/11/6 16:56
 * @Version V1.0
 */
public class Client {
    public static void main(String[] args) {
        //1,创建咖啡店类
        CoffeeStore store = new CoffeeStore();

        AmericanCoffeeFactory americanCoffeeFactory =new AmericanCoffeeFactory();

        store.setFactory(americanCoffeeFactory);

        //2,点咖啡
        Coffee coffee = store.orderCoffee();

        System.out.println(coffee.getName());
    }
}
